package com.mall.controller;

import com.mall.commons.common.CommonResult;
import com.mall.model.domain.UmsMemberLevel;
import com.mall.service.MemberLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/memberLevel")
public class MemberLevelController {
    @Autowired
    private MemberLevelService memberLevelService;

    /**
     * 查询所有会员等级
     * @param defaultStatus
     * @return
     */
    @GetMapping("/list")
    public CommonResult list(Integer defaultStatus){
     List<UmsMemberLevel> levelList = memberLevelService.list(defaultStatus);
       return CommonResult.success(levelList);
    }
}
